package cn.java79.quiz.controller;

import cn.java79.quiz.entity.Admin;
import cn.java79.quiz.pojo.AjaxPage;
import cn.java79.quiz.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author oldliu
 * @since 1.0
 */
//@Controller
@RestController
@RequestMapping("admin")
public class AdminController {
    @Autowired
    private AdminService adminService;

    @GetMapping("search")
    public AjaxPage<Admin> search(String loginname, String realname, String phone, @RequestParam(name = "pageNo", defaultValue = "1") int pageNo) {
        AjaxPage<Admin> search = this.adminService.search(loginname, realname, pageNo);
        return search;
    }
}
